-
Notifications
You must be signed in to change notification settings - Fork 19
introduce SMV enumeration type #1154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f3f9ae8
to
2fc9d2b
Compare
2fc9d2b
to
b2da631
Compare
28a3c20
to
554935c
Compare
src/smvlang/smv_types.cpp
Outdated
for(auto &element1 : elements()) | ||
{ | ||
bool found = false; | ||
for(auto &element2 : other.elements()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the realistic size of enums the quadratic algorithm might not matter too much, but repeatedly invoking other.elements()
seems avoidable. This should be other.find(ID_elements).get_sub()
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now replaced by a set, which makes this n log n.
554935c
to
2fb77f9
Compare
src/smvlang/smv_types.cpp
Outdated
for(auto &element : other_elements_sub) | ||
other_elements.insert(element.id()); | ||
|
||
for(auto &element : elements()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for removing the quadratic approach. But I don't think we should use elements()
here either as for(auto &e : find(ID_elements).get_sub())
would avoid constructing the vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
3ba9b05
to
203f9d0
Compare
SMV enumerations behave differently from enumeration_typet; hence, this introduces smv_enumeration_typet, which is subsequently lowered to enumeration_typet.
203f9d0
to
caeaab7
Compare
SMV enumerations behave differently from
enumeration_typet
; hence, this introducessmv_enumeration_typet
, which is subsequently lowered toenumeration_typet
.